3.2.84 \(\int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx\) [184]

3.2.84.1 Optimal result
3.2.84.2 Mathematica [B] (verified)
3.2.84.3 Rubi [A] (verified)
3.2.84.4 Maple [A] (verified)
3.2.84.5 Fricas [A] (verification not implemented)
3.2.84.6 Sympy [F(-1)]
3.2.84.7 Maxima [A] (verification not implemented)
3.2.84.8 Giac [B] (verification not implemented)
3.2.84.9 Mupad [B] (verification not implemented)

3.2.84.1 Optimal result

Integrand size = 21, antiderivative size = 143 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {\left (a^2+3 b^2\right ) \cot (c+d x)}{d}-\frac {\left (2 a^2+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {\left (a^2+b^2\right ) \cot ^5(c+d x)}{5 d}-\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {2 a b \csc ^5(c+d x)}{5 d}+\frac {b^2 \tan (c+d x)}{d} \]

output
2*a*b*arctanh(sin(d*x+c))/d-(a^2+3*b^2)*cot(d*x+c)/d-1/3*(2*a^2+3*b^2)*cot 
(d*x+c)^3/d-1/5*(a^2+b^2)*cot(d*x+c)^5/d-2*a*b*csc(d*x+c)/d-2/3*a*b*csc(d* 
x+c)^3/d-2/5*a*b*csc(d*x+c)^5/d+b^2*tan(d*x+c)/d
 
3.2.84.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(368\) vs. \(2(143)=286\).

Time = 1.44 (sec) , antiderivative size = 368, normalized size of antiderivative = 2.57 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {\csc ^7\left (\frac {1}{2} (c+d x)\right ) \sec ^5\left (\frac {1}{2} (c+d x)\right ) \left (40 a^2+196 a b \cos (c+d x)+20 \left (a^2+6 b^2\right ) \cos (2 (c+d x))-130 a b \cos (3 (c+d x))-16 a^2 \cos (4 (c+d x))-96 b^2 \cos (4 (c+d x))+30 a b \cos (5 (c+d x))+4 a^2 \cos (6 (c+d x))+24 b^2 \cos (6 (c+d x))+75 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-75 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-60 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+60 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+15 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (6 (c+d x))-15 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (6 (c+d x))\right )}{7680 d \left (-1+\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )} \]

input
Integrate[Csc[c + d*x]^6*(a + b*Sec[c + d*x])^2,x]
 
output
-1/7680*(Csc[(c + d*x)/2]^7*Sec[(c + d*x)/2]^5*(40*a^2 + 196*a*b*Cos[c + d 
*x] + 20*(a^2 + 6*b^2)*Cos[2*(c + d*x)] - 130*a*b*Cos[3*(c + d*x)] - 16*a^ 
2*Cos[4*(c + d*x)] - 96*b^2*Cos[4*(c + d*x)] + 30*a*b*Cos[5*(c + d*x)] + 4 
*a^2*Cos[6*(c + d*x)] + 24*b^2*Cos[6*(c + d*x)] + 75*a*b*Log[Cos[(c + d*x) 
/2] - Sin[(c + d*x)/2]]*Sin[2*(c + d*x)] - 75*a*b*Log[Cos[(c + d*x)/2] + S 
in[(c + d*x)/2]]*Sin[2*(c + d*x)] - 60*a*b*Log[Cos[(c + d*x)/2] - Sin[(c + 
 d*x)/2]]*Sin[4*(c + d*x)] + 60*a*b*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2 
]]*Sin[4*(c + d*x)] + 15*a*b*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]]*Sin[ 
6*(c + d*x)] - 15*a*b*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]*Sin[6*(c + 
d*x)]))/(d*(-1 + Cot[(c + d*x)/2]^2))
 
3.2.84.3 Rubi [A] (verified)

Time = 0.78 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.85, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.619, Rules used = {3042, 4360, 3042, 3390, 25, 3042, 3101, 25, 254, 2009, 4889, 355, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^2}{\cos \left (c+d x-\frac {\pi }{2}\right )^6}dx\)

\(\Big \downarrow \) 4360

\(\displaystyle \int \csc ^6(c+d x) \sec ^2(c+d x) (-a \cos (c+d x)-b)^2dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a \sin \left (c+d x-\frac {\pi }{2}\right )-b\right )^2}{\sin \left (c+d x-\frac {\pi }{2}\right )^2 \cos \left (c+d x-\frac {\pi }{2}\right )^6}dx\)

\(\Big \downarrow \) 3390

\(\displaystyle \int \left (b^2+a^2 \cos ^2(c+d x)\right ) \csc ^6(c+d x) \sec ^2(c+d x)dx-2 a b \int -\csc ^6(c+d x) \sec (c+d x)dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \left (b^2+a^2 \cos ^2(c+d x)\right ) \csc ^6(c+d x) \sec ^2(c+d x)dx+2 a b \int \csc ^6(c+d x) \sec (c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {b^2+a^2 \cos (c+d x)^2}{\cos (c+d x)^2 \sin (c+d x)^6}dx+2 a b \int \csc (c+d x)^6 \sec (c+d x)dx\)

\(\Big \downarrow \) 3101

\(\displaystyle \int \frac {b^2+a^2 \cos (c+d x)^2}{\cos (c+d x)^2 \sin (c+d x)^6}dx-\frac {2 a b \int -\frac {\csc ^6(c+d x)}{1-\csc ^2(c+d x)}d\csc (c+d x)}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \int \frac {b^2+a^2 \cos (c+d x)^2}{\cos (c+d x)^2 \sin (c+d x)^6}dx+\frac {2 a b \int \frac {\csc ^6(c+d x)}{1-\csc ^2(c+d x)}d\csc (c+d x)}{d}\)

\(\Big \downarrow \) 254

\(\displaystyle \int \frac {b^2+a^2 \cos (c+d x)^2}{\cos (c+d x)^2 \sin (c+d x)^6}dx+\frac {2 a b \int \left (-\csc ^4(c+d x)-\csc ^2(c+d x)+\frac {1}{1-\csc ^2(c+d x)}-1\right )d\csc (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \int \frac {b^2+a^2 \cos (c+d x)^2}{\cos (c+d x)^2 \sin (c+d x)^6}dx-\frac {2 a b \left (-\text {arctanh}(\csc (c+d x))+\frac {1}{5} \csc ^5(c+d x)+\frac {1}{3} \csc ^3(c+d x)+\csc (c+d x)\right )}{d}\)

\(\Big \downarrow \) 4889

\(\displaystyle \frac {\int \cot ^6(c+d x) \left (\tan ^2(c+d x)+1\right )^2 \left (a^2+b^2+b^2 \tan ^2(c+d x)\right )d\tan (c+d x)}{d}-\frac {2 a b \left (-\text {arctanh}(\csc (c+d x))+\frac {1}{5} \csc ^5(c+d x)+\frac {1}{3} \csc ^3(c+d x)+\csc (c+d x)\right )}{d}\)

\(\Big \downarrow \) 355

\(\displaystyle \frac {\int \left (\left (a^2+b^2\right ) \cot ^6(c+d x)+\left (2 a^2+3 b^2\right ) \cot ^4(c+d x)+\left (a^2+3 b^2\right ) \cot ^2(c+d x)+b^2\right )d\tan (c+d x)}{d}-\frac {2 a b \left (-\text {arctanh}(\csc (c+d x))+\frac {1}{5} \csc ^5(c+d x)+\frac {1}{3} \csc ^3(c+d x)+\csc (c+d x)\right )}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {1}{5} \left (a^2+b^2\right ) \cot ^5(c+d x)-\frac {1}{3} \left (2 a^2+3 b^2\right ) \cot ^3(c+d x)-\left (a^2+3 b^2\right ) \cot (c+d x)+b^2 \tan (c+d x)}{d}-\frac {2 a b \left (-\text {arctanh}(\csc (c+d x))+\frac {1}{5} \csc ^5(c+d x)+\frac {1}{3} \csc ^3(c+d x)+\csc (c+d x)\right )}{d}\)

input
Int[Csc[c + d*x]^6*(a + b*Sec[c + d*x])^2,x]
 
output
(-2*a*b*(-ArcTanh[Csc[c + d*x]] + Csc[c + d*x] + Csc[c + d*x]^3/3 + Csc[c 
+ d*x]^5/5))/d + (-((a^2 + 3*b^2)*Cot[c + d*x]) - ((2*a^2 + 3*b^2)*Cot[c + 
 d*x]^3)/3 - ((a^2 + b^2)*Cot[c + d*x]^5)/5 + b^2*Tan[c + d*x])/d
 

3.2.84.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 254
Int[(x_)^(m_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[x^m, 
 a + b*x^2, x], x] /; FreeQ[{a, b}, x] && IGtQ[m, 3]
 

rule 355
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q 
_.), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(a + b*x^2)^p*(c + d*x^2)^q, 
x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] & 
& IGtQ[q, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3101
Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_S 
ymbol] :> Simp[-(f*a^n)^(-1)   Subst[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 
 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n 
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])
 

rule 3390
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[2*a*(b/d) 
Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e + f* 
x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, 
e, f, g, n, p}, x] && NeQ[a^2 - b^2, 0]
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 

rule 4889
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors 
[Tan[v], x]}, Simp[d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] &&  !MatchQ[ 
u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I 
ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
 
3.2.84.4 Maple [A] (verified)

Time = 1.76 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.08

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )+2 a b \left (-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (-\frac {1}{5 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {2}{5 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {8}{5 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {16 \cot \left (d x +c \right )}{5}\right )}{d}\) \(154\)
default \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )+2 a b \left (-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (-\frac {1}{5 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {2}{5 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {8}{5 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {16 \cot \left (d x +c \right )}{5}\right )}{d}\) \(154\)
parallelrisch \(\frac {-3840 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \cos \left (d x +c \right )+3840 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (d x +c \right )-\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \csc \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \left (5 \left (a^{2}+6 b^{2}\right ) \cos \left (2 d x +2 c \right )+4 \left (-a^{2}-6 b^{2}\right ) \cos \left (4 d x +4 c \right )+\left (a^{2}+6 b^{2}\right ) \cos \left (6 d x +6 c \right )+10 \left (\frac {3 b \cos \left (5 d x +5 c \right )}{4}+\frac {49 \cos \left (d x +c \right ) b}{10}-\frac {13 b \cos \left (3 d x +3 c \right )}{4}+a \right ) a \right )}{1920 d \cos \left (d x +c \right )}\) \(183\)
risch \(-\frac {4 i \left (15 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-65 a b \,{\mathrm e}^{9 i \left (d x +c \right )}+98 a b \,{\mathrm e}^{7 i \left (d x +c \right )}+40 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+98 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+20 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+120 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-65 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-16 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-96 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+15 a b \,{\mathrm e}^{i \left (d x +c \right )}+4 a^{2}+24 b^{2}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(233\)
norman \(\frac {\frac {a^{2}+2 a b +b^{2}}{160 d}-\frac {5 \left (a^{2}+7 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{8 d}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{160 d}+\frac {\left (11 a^{2}-32 a b +21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{240 d}+\frac {\left (11 a^{2}+32 a b +21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{240 d}+\frac {\left (25 a^{2}-118 a b +105 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{96 d}+\frac {\left (25 a^{2}+118 a b +105 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{96 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) \(260\)

input
int(csc(d*x+c)^6*(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/d*(a^2*(-8/15-1/5*csc(d*x+c)^4-4/15*csc(d*x+c)^2)*cot(d*x+c)+2*a*b*(-1/5 
/sin(d*x+c)^5-1/3/sin(d*x+c)^3-1/sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+b^2 
*(-1/5/sin(d*x+c)^5/cos(d*x+c)-2/5/sin(d*x+c)^3/cos(d*x+c)+8/5/sin(d*x+c)/ 
cos(d*x+c)-16/5*cot(d*x+c)))
 
3.2.84.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.69 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {30 \, a b \cos \left (d x + c\right )^{5} + 8 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 70 \, a b \cos \left (d x + c\right )^{3} - 20 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 46 \, a b \cos \left (d x + c\right ) + 15 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 15 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 15 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 15 \, b^{2}}{15 \, {\left (d \cos \left (d x + c\right )^{5} - 2 \, d \cos \left (d x + c\right )^{3} + d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \]

input
integrate(csc(d*x+c)^6*(a+b*sec(d*x+c))^2,x, algorithm="fricas")
 
output
-1/15*(30*a*b*cos(d*x + c)^5 + 8*(a^2 + 6*b^2)*cos(d*x + c)^6 - 70*a*b*cos 
(d*x + c)^3 - 20*(a^2 + 6*b^2)*cos(d*x + c)^4 + 46*a*b*cos(d*x + c) + 15*( 
a^2 + 6*b^2)*cos(d*x + c)^2 - 15*(a*b*cos(d*x + c)^5 - 2*a*b*cos(d*x + c)^ 
3 + a*b*cos(d*x + c))*log(sin(d*x + c) + 1)*sin(d*x + c) + 15*(a*b*cos(d*x 
 + c)^5 - 2*a*b*cos(d*x + c)^3 + a*b*cos(d*x + c))*log(-sin(d*x + c) + 1)* 
sin(d*x + c) - 15*b^2)/((d*cos(d*x + c)^5 - 2*d*cos(d*x + c)^3 + d*cos(d*x 
 + c))*sin(d*x + c))
 
3.2.84.6 Sympy [F(-1)]

Timed out. \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=\text {Timed out} \]

input
integrate(csc(d*x+c)**6*(a+b*sec(d*x+c))**2,x)
 
output
Timed out
 
3.2.84.7 Maxima [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.00 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {a b {\left (\frac {2 \, {\left (15 \, \sin \left (d x + c\right )^{4} + 5 \, \sin \left (d x + c\right )^{2} + 3\right )}}{\sin \left (d x + c\right )^{5}} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 3 \, b^{2} {\left (\frac {15 \, \tan \left (d x + c\right )^{4} + 5 \, \tan \left (d x + c\right )^{2} + 1}{\tan \left (d x + c\right )^{5}} - 5 \, \tan \left (d x + c\right )\right )} + \frac {{\left (15 \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{2} + 3\right )} a^{2}}{\tan \left (d x + c\right )^{5}}}{15 \, d} \]

input
integrate(csc(d*x+c)^6*(a+b*sec(d*x+c))^2,x, algorithm="maxima")
 
output
-1/15*(a*b*(2*(15*sin(d*x + c)^4 + 5*sin(d*x + c)^2 + 3)/sin(d*x + c)^5 - 
15*log(sin(d*x + c) + 1) + 15*log(sin(d*x + c) - 1)) + 3*b^2*((15*tan(d*x 
+ c)^4 + 5*tan(d*x + c)^2 + 1)/tan(d*x + c)^5 - 5*tan(d*x + c)) + (15*tan( 
d*x + c)^4 + 10*tan(d*x + c)^2 + 3)*a^2/tan(d*x + c)^5)/d
 
3.2.84.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (135) = 270\).

Time = 0.36 (sec) , antiderivative size = 326, normalized size of antiderivative = 2.28 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 25 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 45 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 960 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 960 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 660 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 570 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {960 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \frac {150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 660 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 570 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 25 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 45 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{2} + 6 \, a b + 3 \, b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \]

input
integrate(csc(d*x+c)^6*(a+b*sec(d*x+c))^2,x, algorithm="giac")
 
output
1/480*(3*a^2*tan(1/2*d*x + 1/2*c)^5 - 6*a*b*tan(1/2*d*x + 1/2*c)^5 + 3*b^2 
*tan(1/2*d*x + 1/2*c)^5 + 25*a^2*tan(1/2*d*x + 1/2*c)^3 - 70*a*b*tan(1/2*d 
*x + 1/2*c)^3 + 45*b^2*tan(1/2*d*x + 1/2*c)^3 + 960*a*b*log(abs(tan(1/2*d* 
x + 1/2*c) + 1)) - 960*a*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 150*a^2*ta 
n(1/2*d*x + 1/2*c) - 660*a*b*tan(1/2*d*x + 1/2*c) + 570*b^2*tan(1/2*d*x + 
1/2*c) - 960*b^2*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 1) - (150* 
a^2*tan(1/2*d*x + 1/2*c)^4 + 660*a*b*tan(1/2*d*x + 1/2*c)^4 + 570*b^2*tan( 
1/2*d*x + 1/2*c)^4 + 25*a^2*tan(1/2*d*x + 1/2*c)^2 + 70*a*b*tan(1/2*d*x + 
1/2*c)^2 + 45*b^2*tan(1/2*d*x + 1/2*c)^2 + 3*a^2 + 6*a*b + 3*b^2)/tan(1/2* 
d*x + 1/2*c)^5)/d
 
3.2.84.9 Mupad [B] (verification not implemented)

Time = 14.21 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.73 \[ \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\left (a-b\right )}^2}{160\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a^2}{32}-\frac {5\,a\,b}{48}+\frac {7\,b^2}{96}+\frac {{\left (a-b\right )}^2}{48}\right )}{d}-\frac {\frac {2\,a\,b}{5}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {22\,a^2}{15}+\frac {64\,a\,b}{15}+\frac {14\,b^2}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (10\,a^2+44\,a\,b+102\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {25\,a^2}{3}+\frac {118\,a\,b}{3}+35\,b^2\right )+\frac {a^2}{5}+\frac {b^2}{5}}{d\,\left (32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {7\,a^2}{32}-\frac {19\,a\,b}{16}+\frac {35\,b^2}{32}+\frac {3\,{\left (a-b\right )}^2}{32}\right )}{d}+\frac {4\,a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

input
int((a + b/cos(c + d*x))^2/sin(c + d*x)^6,x)
 
output
(tan(c/2 + (d*x)/2)^5*(a - b)^2)/(160*d) + (tan(c/2 + (d*x)/2)^3*(a^2/32 - 
 (5*a*b)/48 + (7*b^2)/96 + (a - b)^2/48))/d - ((2*a*b)/5 + tan(c/2 + (d*x) 
/2)^2*((64*a*b)/15 + (22*a^2)/15 + (14*b^2)/5) - tan(c/2 + (d*x)/2)^6*(44* 
a*b + 10*a^2 + 102*b^2) + tan(c/2 + (d*x)/2)^4*((118*a*b)/3 + (25*a^2)/3 + 
 35*b^2) + a^2/5 + b^2/5)/(d*(32*tan(c/2 + (d*x)/2)^5 - 32*tan(c/2 + (d*x) 
/2)^7)) + (tan(c/2 + (d*x)/2)*((7*a^2)/32 - (19*a*b)/16 + (35*b^2)/32 + (3 
*(a - b)^2)/32))/d + (4*a*b*atanh(tan(c/2 + (d*x)/2)))/d